package com.tjh.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tjh.common.to.mq.SeckillOrderTo;
import com.tjh.common.utils.PageUtils;
import com.tjh.gulimall.order.entity.OrderEntity;
import com.tjh.gulimall.order.vo.OrderConfirmVo;
import com.tjh.gulimall.order.vo.OrderSubmitVo;
import com.tjh.gulimall.order.vo.PayAsyncVo;
import com.tjh.gulimall.order.vo.PayVo;
import com.tjh.gulimall.order.vo.SubmitOrderResponseVo;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * Create by koala on 2021-01-24 21:50:38
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * day117：返回订单确认页需要用到的数据
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * day122：下单功能
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo);

    /**
     * day130：查询订单状态
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    /**
     * day131：订单超时未支付进行关单操作
     */
    void closeOrder(OrderEntity entity);

    /**
     * day132：支付宝支付
     */
    PayVo getOrderPay(String orderSn);

    /**
     * day133：处理支付宝的支付结果
     */
    String handlePayResult(PayAsyncVo vo);

    /**
     * day132：分页查询当前登录用户的所有订单
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * day139：创建秒杀订单
     */
    void createSeckillOrder(SeckillOrderTo seckillOrder)
            ;
}

